<?php
header("content-type:text/html;charset=utf-8");
include_once "../lib/databases.php";
include_once "../lib/function.php";
//接收要删除的记录id
$id = isset($_POST['id']) ? $_POST['id'] : "";
//判断是否接受到id数据
if($id != ""){
    //根据id删除账单
    $del_sql = "delete from account where id = {$id}";
    $res = $db->execSql($del_sql);
    if($res){
        //添加删除日志
        $db->insertLog($_SESSION['user_info']['id'],$_SESSION['user_info']['name'],'del','删除财务账单');
        echo $fun->success("删除账单成功");
    }else{
        echo $fun->error("删除账单失败");
    }
}
